package com.tobby.camel.camelinaction.chapter2.contextscan;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.spring.SpringRouteBuilder;
import org.springframework.stereotype.Component;

@Component
public class FileToJmsRoute extends SpringRouteBuilder {

	@Override
	public void configure() throws Exception {
		from("file:src/main/resources/data?noop=true").process(new Processor() {
			public void process(Exchange exchange) throws Exception {
				System.out.println("We just downloaded: "
						+ exchange.getIn().getHeader("CamelFileName"));
			}
		}).to("jms:incomingOrders");
	}

}
